Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to increase quality of the codebase #1654

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

datengraben
Copy link
Contributor

@hansmorb

  • Fixes missing imports, typos in type hints (though syntactically correct)
  • Adds or fixes docblocks
  • Adds missing return statements of functions that are not void

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

Attention: Patch coverage is 59.09091% with 9 lines in your changes missing coverage. Please review.

Project coverage is 50.39%. Comparing base (4191084) to head (b4fed3b).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/Wordpress/CustomPostType/Map.php 0.00% 2 Missing ⚠️
src/API/AvailabilityRoute.php 0.00% 1 Missing ⚠️
src/Model/CustomPost.php 0.00% 1 Missing ⚠️
src/Repository/CB1.php 0.00% 1 Missing ⚠️
src/Service/BookingRuleApplied.php 0.00% 1 Missing ⚠️
src/Wordpress/CustomPostType/Location.php 0.00% 1 Missing ⚠️
src/Wordpress/CustomPostType/Timeframe.php 50.00% 1 Missing ⚠️
src/Wordpress/Widget/UserWidget.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1654      +/-   ##
============================================
- Coverage     50.41%   50.39%   -0.02%     
+ Complexity     2719     2718       -1     
============================================
  Files            99       99              
  Lines         11296    11298       +2     
============================================
- Hits           5695     5694       -1     
- Misses         5601     5604       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@datengraben datengraben added technical Non-functional changes (refactorings or increase test coverage) dx Developer Experience (technical) php Pull requests that update Php code documentation labels Nov 1, 2024
Copy link
Contributor

@hansmorb hansmorb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nur Kleinigkeiten und Klarifizierungen. Ich kann leider nicht bei jeder geänderten Codestelle das manuell testen, ich verlasse mich jetzt da mal auf unsere automatisierten Tests.


// This was missing in previous versions. According to the availability spec, we can return a list with no items
// TODO this part and the enclosing if-clause can be removed in future version, if no problems arose ...
return new WP_REST_Response( $data, 200 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funktioniert das auch? Also gibt der dann erfolgreich eine leere Liste zurück? Wenn ja kann das so bleiben.

@@ -9,6 +9,8 @@
*/
abstract class BaseShortcode {

final public function __construct() { }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Der Konstruktor wird aber nicht nochmal von den erbenden Klassen benutzt, muss der dann trotzdem hier angegeben werden? Bzw welchen Sinn hat es dann ihn da anzugeben?

@@ -286,7 +286,7 @@ public static function init( bool $ignoreErrors = false ):array{
}
try {
$bookingRule->setAppliedParams(
$ruleParams ?? [],
$ruleParams,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Geht das dann immer noch mit Regeln die keine ruleParams definiert haben? Ich meine ich hab das eingeführt, weil es sonst einen fatal Error mit solchen Regeln gab.

@@ -51,8 +52,7 @@ public static function getView() {
**/
public static function replace_map_link_target() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Die Funktion ist sowieso unbenutzt, nicht? Also lohnt es sich vielleicht gar nicht da was dran zu ändern.

@@ -114,6 +119,8 @@ public function form( $instance ) {
</p>
<?php

return ''; // Parent class returns string, not used
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Für das UserWidget haben wir keinen automatisierten Test, geht das noch? Wenn ja passt das!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation dx Developer Experience (technical) php Pull requests that update Php code technical Non-functional changes (refactorings or increase test coverage)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants